#include "MoveRowNetworkEvent.h"
#include "Row.h"

MoveRowNetworkEvent::MoveRowNetworkEvent(long rowId)
{
    message.header.code = NetworkEvent::SERVER_MOVE_ROW;
    message.header.sizeOfData = sizeof(message) - sizeof(message.header);
    message.data.rowId = rowId;
}

MoveRowNetworkEvent::MoveRowNetworkEvent(const Header& header, const Data& data)
{
    message.header = header;
    message.data = data;
}

MoveRowNetworkEvent::~MoveRowNetworkEvent()
{
}

void* MoveRowNetworkEvent::getMessageBlob()
{
    return &message;
}

size_t MoveRowNetworkEvent::getMessageBlobSize()
{
    return sizeof(message);
}

void MoveRowNetworkEvent::visitRow(Row* row) const
{
    row->handleMoveRowEvent(message.data.rowId);
}

